#travese2.py
class1 = ['zhangsan','lisi','wangwu','zhaoliu']
print('there are {} student in this class:'.format(class1.__len__()))

print('\n下标正向遍历\n')
current = 0;
last = len(class1) -1
while current <= last:
    student = class1[current]
    print(student,end=' ')
    current = current + 1

print('\n下标反向遍历\n')
current = len(class1) -1
last = 0
while current >= last:
    student = class1[current]
    print(student,end=' ')
    current = current - 1    